// convert struct to json

package main


import (
	"fmt"
	"encoding/json"
)
type Play struct {
	PlayID     int     `json:"play_id"`
	PlayName   string  `json:"play_name"`
	PlayImg    string  `json:"play_img"`
	PlayImg2   string  `json:"play_img_2"` // ui改版，新版用这个图片
	PlayURL    string  `json:"play_url"`
	GameId     int     `json:"game_id"`   //游戏id
	GameType   int     `json:"game_type"` //0、h5;1、cocos
	PlaySwitch int     `json:"play_switch"`
	From       string  `json:"from"`
	Proportion float64 `json:"proportion"` //h5页面的宽高比
}

func main() {
	ItemJson()
}

func ItemJson()  {
	var Plays = []Play{
		{
			PlayID:     1,
			PlayName:   "砸金蛋",
			PlayImg:    "https://img.misslooker.com/MTY1MjI3NTE3OTk0OCM4MTEjcG5n.png",
			PlayURL:    "https://testh5.misslooker.com/innerapp/game/egg/index.html",
			PlayImg2:   "https://img.misslooker.com/MTY1MjI3NTE3OTk0OCM4MTEjcG5n.png",
			PlaySwitch: 1,
			From:       "drawer",
			Proportion: 0.75,
		},
		{
			PlayID:     3,
			PlayName:   "告白墙",
			PlayImg:    "https://img.misslooker.com/MTYzOTcxMjk1NjgwOSM4MTYjcG5n.png",
			PlayURL:    "https://testh5.misslooker.com/innerapp/say-wall/index.html",
			PlayImg2:   "https://img.misslooker.com/MTYzOTcxMjk1NjgwOSM4MTYjcG5n.png",
			PlaySwitch: 1,
			From:       "drawer",
			Proportion: 0.64,
		},
		{
			PlayID:     2, // 端上有动画
			PlayName:   "魔法转盘",
			PlayImg:    "https://img.misslooker.com/MTY1MjI3NTEyODA2NyM0MjYjcG5n.png",
			PlayURL:    "https://testh5.misslooker.com/innerapp/live-game/index.html",
			PlayImg2:   "https://img.misslooker.com/MTY1MjI3NTEyODA2NyM0MjYjcG5n.png",
			PlaySwitch: 1,
			From:       "drawer",
			Proportion: 0.79,
		},
		{
			PlayID:     4,
			PlayName:   "火花寻宝",
			PlayImg:    "http://media.misslooker.com/MTY0MjY4NTE2NzI3OCM1NTYjcG5n.png",
			PlayURL:    "https://testh5.misslooker.com/innerapp/game/bomb/index.html",
			PlayImg2:   "https://img.misslooker.com/MTYzOTcxMjk1Njk3MiMyMDcjcG5n.png",
			PlaySwitch: 0,
			From:       "drawer",
			Proportion: 0.61,
		},
		{
			PlayID:     5,
			PlayName:   "魔术卡牌",
			PlayImg:    "https://img.misslooker.com/MTYzODI1NDk5MzMwMyMgNzgjcG5n.png",
			PlayURL:    "https://testh5.misslooker.com/innerapp/game/card/index.html",
			PlayImg2:   "https://img.misslooker.com/MTYzOTcxMjk1Njg4OSM5NjcjcG5n.png",
			PlaySwitch: 1,
			From:       "drawer",
			Proportion: 0.75,
		},
		{
			PlayID:     6,
			PlayName:   "萌宠酷跑",
			PlayImg:    "https://img.misslooker.com/MTY2MzgxMzA2Nzk5MiMzNTQjcG5n.png",
			PlayURL:    "",
			PlayImg2:   "https://img.misslooker.com/MTY2MzgxMzA2Nzk5MiMzNTQjcG5n.png",
			PlaySwitch: 1,
			From:       "drawer",
			Proportion: 0.75,
			GameId:     16858,
			GameType:   1,
		},
		{
			PlayID:     7,
			PlayName:   "中华英雄",
			PlayImg:    "https://img.misslooker.com/MTY2MzkyNTcyNjE3MiM1OTgjcG5n.png",
			PlayURL:    "https://testservice.misslooker.com/api/game/stone/enter?gid=10001",
			PlayImg2:   "https://img.misslooker.com/MTY2MzkyNTcyNjE3MiM1OTgjcG5n.png",
			PlaySwitch: 1,
			From:       "drawer",
			Proportion: 0.625,
		},
		{
			PlayID:     8,
			PlayName:   "欢乐赛鱼",
			PlayImg:    "http://media.misslooker.com/MTY2NjA3MjkzOTUxMCM3ODIjcG5n.png",
			PlayURL:    "",
			PlayImg2:   "http://media.misslooker.com/MTY2NjA3MjkzOTUxMCM3ODIjcG5n.png",
			PlaySwitch: 1,
			From:       "drawer",
			Proportion: 0.75,
			GameId:     1,
			GameType:   1,
		},
	}


	b, err := json.Marshal(Plays)
	if err != nil {

		fmt.Println("Umarshal failed:", err)
		return
	}


	fmt.Println("json:", string(b))
}